package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.TixianBean;
import com.lwj.liwanjia.impl.TixianView;
import com.lwj.liwanjia.model.TixianModel;

import rx.Subscriber;

/**
 * Created by Administrator on 2018/1/10.
 */

public class TixianPresenter {
    private TixianModel tixianModel;
    private TixianView tixianView;

    public TixianPresenter(TixianView tixianView) {
        this.tixianView = tixianView;
        this.tixianModel = new TixianModel();
    }

    public void getTxState(String token) {
        tixianModel.getTxState(token, new Subscriber<TixianBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                tixianView.showError((Exception) e);
            }

            @Override
            public void onNext(TixianBean tixianBean) {
                tixianView.getTxState(tixianBean);
            }
        });
    }
}
